<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/vectrics.tld" prefix="vectrics" %>

<%@ page import="org.vectrics.user.*" %>
<%@ page import="org.vectrics.provider.*" %>
<%@ page import="org.vectrics.hibernate.*" %>
<%@ page import="org.vectrics.domain.*" %>
<%@ page import="org.vectrics.struts.*" %>

<%
    Request vectricsRequest = HttpRequestConverter.convertRequest(request);
	Domain domain = CoreServiceLocator.getUserAuthService().getSessionDomain(vectricsRequest);
	String domainName = "";
	if (domain != null)
		domainName = domain.getDescription();

	//Person authPerson = ThreadProperties.getPerson();
	Person authPerson = CoreServiceLocator.getUserAuthService().getAuthorizedPerson(session);
	String authPersonName = "";
	if (authPerson != null) {
        authPersonName = authPerson.getName();
	}
%>

<table cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top" width="10%">
			<img src="/hrs-intranet/graphics/admin_flashrecruit.gif" width="350" height="36" alt="Hexacta Resources System">
		</td>

		<td valign="bottom" align="center" width="50%">
		</td>

		<%
			if (!domainName.equalsIgnoreCase("")) {
		%>
		<td valign="top" align="right" width="10%" style="position:absolute; right:220px;">
			<table class="hdrUser">
				<tr>
					<td><font class="stdBoldFont">User</font></td>
					<td><font class="stdBoldFont">Domain</font></td>
				</tr>
				<tr>
					<td><%=authPersonName%></td>
					<td><%=domainName%></td>
				</tr>
			</table>
		</td>

		<td valign="bottom" align="right" width="10%" style="position:absolute; right:2px;">
			<table class="hdrUser">
				<tr>
					<td>
						<a href="/hrs-intranet/logoff.do">
							<font class="stdBoldFont">Sign Out</font>
						</a>
					</td>
				</tr>
			</table>
		</td>

		<%
			} else {
		%>
		<td valign="top" align="right" width="20%">
			&nbsp;
		</td>
		<%
			}
		%>
	</tr>
	
</table>
